@import '~components/constants.scss';

/**
INPUTS
**/

.input,
.switch,
.checkbox {
  vertical-align: middle;
  box-sizing: border-box;
  outline: none;
  box-sizing: border-box;

  &.big {
    font-size: 16px;
    padding-top: 21px;
    padding-bottom: 21px;
    line-height: 22px;
  }
  &.medium {
    font-size: 14px;
    padding-top: 10px;
    padding-bottom: 10px;
    line-height: 20px;
  }
  &.small {
    font-size: 14px;
    padding-top: 6px;
    padding-bottom: 6px;
    line-height: 20px;
  }
}

.input {
  border-radius: var(--default-border-radius);
  border: 0px;
  background: $grey_background;
  color: $black;

  &:hover {
    background: #eee;
  }
  &:active,
  &:focus {
    outline: none;
  }

  &.error {
    background: #ffeeee;
  }

  &::placeholder,
  &:-ms-input-placeholder,
  &::-ms-input-placeholder {
    color: $grey_dark;
  }

  &.big {
    height: 64px;
    padding: 0 16px;
    font-weight: 500;
    font-size: 16px;
  }
  &.medium {
    height: 40px;
    padding: 0 16px;
    font-weight: 500;
    font-size: 14px;
  }
  &.small {
    height: 32px;
    padding: 0 8px;
    font-size: 14px;
  }
}

.switch {
  height: 20px;
  width: 34px;
  background: $grey_light;
  border-radius: 10px;
  display: inline-block;
  padding: 3px;
  box-sizing: border-box;
  transition: background 0.2s;
  cursor: pointer;

  &.disabled {
    pointer-events: none;
    background: $primary_background !important;
  }

  .state {
    background: $white;
    transform: translateX(0%);
    transition: transform 0.2s;
  }

  &.on {
    background: $primary;
    .state {
      transform: translateX(100%);
    }
  }

  &.big {
    padding: 4px;
    height: 32px;
    width: 56px;
    border-radius: 16px;
    margin-top: 16px;
    margin-bottom: 16px;
    .state {
      width: 24px;
      height: 24px;
      border-radius: 12px;
    }
  }

  &.medium {
    height: 24px;
    width: 42px;
    border-radius: 12px;
    padding-top: 3px;
    padding-bottom: 3px;
    margin-top: 8px;
    margin-bottom: 8px;
    .state {
      width: 18px;
      height: 18px;
      border-radius: 9px;
    }
  }

  &.small {
    padding: 3px;
    height: 20px;
    width: 34px;
    border-radius: 10px;
    margin-top: 2px;
    margin-bottom: 2px;
    .state {
      width: 14px;
      height: 14px;
      border-radius: 7px;
    }
  }
}

.checkbox {
  border: 1px solid $grey_light;
  border-radius: var(--default-border-radius);
  display: inline-block;
  padding: 0px;
  box-sizing: border-box;
  transition: background 0.2s;
  cursor: pointer;
  margin-top: 1px;

  &.disabled {
    pointer-events: none;
    background: $primary_background !important;
  }

  .state {
    border-radius: var(--default-border-radius);
    transform: scale(0);
    transition: transform 0.2s, opacity 0.2s;
    .m-icon-small {
      color: $white;
      font-size: 16px !important;
    }
  }

  &.on {
    background: $primary;
    border-color: $primary;
    .state {
      transform: scale(1);
    }
  }

  &.big {
    height: 32px;
    width: 32px;
    margin-top: 16px;
    margin-bottom: 16px;
    padding: 0;
    .state {
      width: 22px;
      height: 22px;
      .m-icon-small {
        font-size: 30px !important;
      }
    }
  }

  &.medium {
    height: 24px;
    width: 24px;
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 0;
    .state {
      width: 18px;
      height: 18px;
      .m-icon-small {
        font-size: 22px !important;
      }
    }
  }

  &.small {
    height: 16px;
    width: 16px;
    margin-top: 4px;
    margin-bottom: 4px;
    padding: 0;
    .state {
      width: 14px;
      height: 14px;
      .m-icon-small {
        font-size: 14px !important;
      }
    }
  }
}

.radio {
  background: $grey_light;
  border-radius: 50%;
  display: inline-block;
  padding: 5px;
  box-sizing: border-box;
  transition: background 0.2s;
  cursor: pointer;
  margin-top: 1px;
  display: inline-block;
  vertical-align: middle;

  &.disabled {
    pointer-events: none;
    background: $primary_background !important;
  }

  .state {
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.2s, opacity 0.2s;
    background: #fff;
  }

  &.on {
    background: $primary;
    .state {
      transform: scale(1);
    }
  }

  &.big {
    height: 32px;
    width: 32px;
    padding: 8px;
    margin-top: 16px;
    margin-bottom: 16px;
    .state {
      width: 16px;
      height: 16px;
    }
  }

  &.medium {
    height: 24px;
    width: 24px;
    padding: 6px;
    margin-top: 8px;
    margin-bottom: 8px;
    .state {
      width: 12px;
      height: 12px;
    }
  }

  &.small {
    height: 16px;
    width: 16px;
    padding: 3px;
    margin-top: 4px;
    margin-bottom: 4px;
    .state {
      width: 10px;
      height: 10px;
    }
  }
}

select {
  -webkit-appearance: none;
}
select,
.select {
  width: 100%;
  border: solid 1px rgba(0, 0, 0, 0.3);
  height: 40px;
  border-radius: $base_border_radius;
  background: white;
  font-size: 14px;
  opacity: 0.8;
  background-image: url();
  background-repeat: no-repeat;
  background-size: 16px;
  background-position: right 10px center;
  padding: 0 10px;

  &.big {
    height: 64px;
    font-size: 16px;
    padding: 0 16px;
  }

  &.medium {
    height: 40px;
    font-size: 14px;
    padding: 0 16px;
  }

  &.small {
    height: 32px;
    font-size: 14px;
    padding: 0 8px;
  }
}
.select {
  line-height: 38px;
  display: inline-block;
  padding-right: 40px;
}

.input_with_emoji {
  display: inline-flex;

  .right_input {
    flex: 1;
    overflow: hidden;
    position: relative;
    border-radius: var(--default-border-radius);
  }

  .emoji {
    width: 40px;
    height: 40px;
    display: inline-block;
    background: $grey_background;
    border-radius: var(--default-border-radius);
    margin-right: 4px;
    padding: 11px;
    font-size: 18px;
    line-height: 20px;
    box-sizing: border-box;
    cursor: pointer;

    &:hover {
      background: $grey_light;
    }
  }
}

.input_with_color {
  display: inline-flex;

  .right_input {
    flex: 1;
    overflow: hidden;
    position: relative;
    border-radius: var(--default-border-radius);
  }

  .color {
    width: 40px;
    height: 40px;
    display: inline-block;
    background: $grey_background;
    border-radius: var(--default-border-radius);
    margin-right: 4px;
    padding: 14px;
    box-sizing: border-box;
    cursor: pointer;

    &:hover {
      background: $grey_light;
    }

    .acolor {
      width: 12px;
      height: 12px;
      border-radius: 6px;
      display: inline-block;
      background-color: #000;
    }
  }
}

.input_icon {
  position: relative;
  display: inline-block;
  width: 100%;

  .autoheight_container {
    padding-left: 16px !important;
  }

  .right_input {
    flex: 1;
    overflow: hidden;
    position: relative;
    border-radius: var(--default-border-radius);
  }

  &.input_enter {
    & > i {
      position: absolute;
      right: 0;
      padding-top: 12px;
      padding-right: 8px;
      width: 24px;
      color: $grey_dark;
      font-size: 16px;
    }

    &.small {
      input.input {
        padding-left: 12px;
      }
    }

    input.input {
      padding-right: 34px;
      padding-left: 0px;
    }
  }

  &:not(.input_enter) {
    & > i {
      position: absolute;
      padding-top: 12px;
      padding-left: 8px;
      width: 24px;
      color: $grey_dark;
    }

    input.input {
      padding-left: 34px;
    }
  }

  &.big {
    & > i {
      position: absolute;
      padding-top: 20px;
      padding-left: 12px;
      width: 32px;
      color: $grey_dark;
      font-size: 20px;
    }

    input.input {
      padding-left: 48px;
    }
  }

  &.small {
    & > i {
      position: absolute;
      padding-top: 8px;
      padding-left: 8px;
      width: 24px;
      color: $grey_dark;
      font-size: 14px;
    }

    input.input {
      padding-left: 32px;
    }
  }
}

.radio_with_label,
.checkbox_with_label,
.switch_with_label {
  display: inline-block;
  .label {
    display: inline;
    vertical-align: middle;
    font-weight: 500;
    margin-left: 8px;
    cursor: pointer;
  }
  &.big {
    .label {
      line-height: 64px;
      margin-left: 8px;
    }
  }
  &.medium {
    .label {
      line-height: 40px;
      margin-left: 8px;
    }
  }
  &.small {
    .label {
      line-height: 32px;
      margin-left: 8px;
      font-size: 14px;
    }
  }
}

/*
.input_with_emoji {
  display: flex;
  padding: 0px 10px;

  input {
    font-size: 13px;
    margin: 0px;
    height: 28px;
  }

  .emoji {
    width: 28px;
    height: 28px;
    display: inline-block;
    background: #F2F2F2;
    border-radius: var(--default-border-radius-large);
    margin-right: 4px;
    padding: 7px 5px;
    box-sizing: border-box;
    cursor: pointer;

    &:hover {
      background: #EAEAEA;
    }
  }
}

.input_with_color {
  display: flex;
  padding: 0px 10px;

  input {
    font-size: 13px;
    margin: 0px;
    height: 28px;
  }

  .color {
    width: 28px;
    height: 28px;
    display: inline-block;
    background: #F2F2F2;
    border-radius: var(--default-border-radius-large);
    margin-right: 4px;
    padding: 8px;
    box-sizing: border-box;
    cursor: pointer;

    &:hover {
      background: #EAEAEA;
    }

    .acolor{
      width: 12px;
      height: 12px;
      border-radius: 6px;
      display: inline-block;
      background-color: #000;
    }

  }
}

.input_icon {
  position: relative;
  display: inline-block;
  width: 100%;

  .m-icon-small {
    position: absolute;
    top: 18px;
    left: 8px;
    opacity: 0.3;
  }

  input {
    padding-left: 30px;
  }

}

.switch_with_label {
  cursor: pointer;
  display: flex;
  .label {
    min-height: 20px;
    font-size: 13px;
    padding-left: 5px;
    padding-top: 2px;
    flex: 1;
    opacity: 0.5;
  }

  &.on {
    .label {
      opacity: 1;
    }
  }
}
.switch_with_label.disabled{
    cursor:not-allowed;
    opacity: 0.5;
}
.switch.disabled{
    cursor:not-allowed;
    opacity: 0.5;
}
.switch {
  height: 20px;
  width: 34px;
  background: #d6d6d6;
  border-radius: 10px;
  display: inline-block;
  padding: 3px;
  box-sizing: border-box;
  transition: background 0.2s;
  cursor: pointer;

  .state {
    width: 14px;
    height: 14px;
    border-radius: 12px;
    background: #FFF;
    transform: translateX(0%);
    transition: transform 0.2s;
  }

  &.on {
    background: $primary;

    .state {
      transform: translateX(100%);
    }

  }
}




.radio_with_label {
  cursor: pointer;
  display: flex;
  .label {
    min-height: 20px;
    font-size: 13px;
    padding-left: 5px;
    padding-top: 2px;
    flex: 1;
    opacity: 0.5;
  }

  &.on {
    .label {
      opacity: 1;
    }
  }
}
.radio {
  height: 16px;
  width: 16px;
  background: #d6d6d6;
  border-radius: 10px;
  display: inline-block;
  padding: 5px;
  box-sizing: border-box;
  transition: background 0.2s;
  cursor: pointer;
  margin-top: 1px;

  .state {
    width: 6px;
    height: 6px;
    border-radius: 12px;
    background: #FFF;
    transform: scale(0);
    transition: transform 0.2s, opacity 0.2s;
  }

  &.on {
    background: $primary;

    .state {
      transform: scale(1);
    }

  }
}


.checkbox_with_label {
  cursor: pointer;
  display: flex;
  .label {
    min-height: 20px;
    font-size: 13px;
    padding-left: 5px;
    padding-top: 2px;
    flex: 1;
    opacity: 0.5;
  }

  &.on {
    .label {
      opacity: 1;
    }
  }
}
.checkbox {
  height: 16px;
  width: 16px;
  background: #d6d6d6;
  border-radius: var(--default-border-radius);
  display: inline-block;
  padding: 5px;
  box-sizing: border-box;
  transition: background 0.2s;
  cursor: pointer;
  margin-top: 1px;

  .state {
    width: 6px;
    height: 6px;
    border-radius: var(--default-border-radius);
    transform: scale(0);
    transition: transform 0.2s, opacity 0.2s;

    .m-icon-small {
      color: #FFF;
      transform: translateX(-5PX) translateY(-5px);
      font-size: 16px !important;
    }
  }

  &.on {
    background: $primary;

    .state {
      transform: scale(1);
    }

  }
}
*/
